import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import ElementUI from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import hljs from "highlight.js";
import "highlight.js/styles/vs2015.css";
import Axios from "../utils/request";

//定义代码高亮指令
Vue.directive("highlight", function (el) {
  let highlight = el.querySelectorAll("pre code");
  highlight.forEach((block) => {
    hljs.highlightBlock(block);
  });
});

// 初始化
Vue.prototype.$hljs = hljs;
Vue.prototype.$axios = Axios;
Vue.use(ElementUI);
Vue.config.productionTip = false;

new Vue({
  router,
  store,
  render: function (h) {
    return h(App);
  },
}).$mount("#app");
